import com.google.common.collect.Multimap;
import org.baicaixiaozhan.utils.AES256GCMUtils;

import java.util.*;

/**
 * @author baicaixiaozhan
 */
public class AESGCMExample {

    public static void main(String[] args) throws Exception {
        final List<Map<String, Object>> mapList = new ArrayList<>();

        Map<String, Object> map = new LinkedHashMap<>();
        map.put("name", "zhangsan");
        map.put("address", "");
        map.put("age", 15);

        mapList.add(map);
        mapList.add(map);
        mapList.add(map);
        mapList.add(map);

//        AES256GCMUtils.encryptDataToCsvFile(mapList, "C:\\Users\\yj\\Desktop\\test\\mapList-encrypt.csv");
        final Multimap<String, Object> multimap = AES256GCMUtils.decryptCsvFileToObject("C:\\Users\\yj\\Desktop\\test\\mapList-encrypt.csv");

       multimap.get("values").forEach(d -> {
           for (Object o : (ArrayList<Object>) d) {
               System.out.println(o);
           }
       });

    }

}
